<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>Hello World!</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      user-select: none;
      transition: all 0.25s;
    }

    body {
      position: relative;
      width: 100vw;
      height: 100vh;
      display: flex;
      flex-direction: column;
    }

    .top {
      position: absolute;
      display: flex;
      flex-direction: row;
      width: 100vw;
      height: 50px;
      background-color: #000;
      z-index: 999;
    }

    .move {
      flex: 1;
    }

    .btn {
      display: flex;
      justify-content: center;
      align-items: center;
      justify-content: space-between;
    }

    .btn img {
      height: 100%;
      padding: 15px 20px;
      user-select: none;
    }

    .btn img:hover {
      background-color: #555;
    }
  </style>
</head>

<body>
  <div class="top">
    <div class="move" style="-webkit-app-region: drag"></div>
    <div class="btn">
      <img class="min" src="../img/min.png" alt="">
      <img class="max" src="../img/max.png" alt="">
      <img class="close" src="../img/close.png" alt="">
    </div>
  </div>
  <script>
    const { ipcRenderer: ipc } = require('electron');
    const min = document.querySelector('.min');
    const max = document.querySelector('.max');
    const shutDown = document.querySelector('.close');

    min.addEventListener('click', function () {
      ipc.send('mini', '');
    });
    max.addEventListener('click', function () {
      ipc.send('max', '');
    });
    shutDown.addEventListener('click', function () {
      ipc.send('close', '');
    });
  </script>
</body>

</html>